﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Pages_Admin_ManageBranches_AddBranch : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            try
            {
                string pinCode = txtPincode.Text;
                string branchName = txtBranchName.Text;
                string branchAddress = txtBranchAddress.Text;
                string branhPhone = txtBranchPhone.Text;
                string branchFax = txtFax.Text;
                string cityID = ddlCityName.SelectedValue;
                if (DALBranch.AddBranch(pinCode, branchAddress, branchName, branchFax, branhPhone, cityID))
                {
                    lblMessage.Text = "Insert Successful";
                }
                else
                {
                    lblMessage.Text = "Insert Fail";
                }
            }
            catch
            {
                lblMessage.Text = "Insert Fail";
            }
            
        }
    }
    protected void btnReset_Click(object sender, EventArgs e)
    {
        txtPincode.Text = "";
        txtBranchName.Text = "";
        txtBranchAddress.Text = "";
        txtBranchPhone.Text = "";
        txtFax.Text = "";
    }
}
